package com.zhijian.wharf.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author HCG
 * @version 1.0
 * @date 2024-07-24
 */
public class EnvMonitorEnum {

    /**
     * 风向枚举类
     *
     * @author HCG
     * @version 1.0
     * @date 2024-07-24
     */
    @AllArgsConstructor
    @Getter
    public enum FxEnum {

        ZERO("0", "北风"),
        ONE("1", "东北风"),
        TWO("2", "东北风"),
        THREE("3", "东南风"),
        FOUR("4", "南风"),
        FIVE("5", "西南风"),
        SIX("6", "西风"),
        SEVEN("7", "西北风");

        private String code;
        private String content;

        public static FxEnum getByCode(String code) {
            FxEnum[] values = FxEnum.values();
            for (FxEnum anEnum : values) {
                if (anEnum.getCode().equals(code)) {
                    return anEnum;
                }
            }
            return null;
        }

    }

    /**
     * 监测向枚举类
     *
     * @author HCG
     * @version 1.0
     * @date 2024-07-24
     */
    @AllArgsConstructor
    @Getter
    public enum ItemEnum {

        TMP("温度", "°C"),
        HR("湿度", "%RH"),
        PRS("压强", "压强"),
        ILL("光照强度", "lx"),
        sTMP("土壤温度", "°C"),
        wTMP("水环境温度", "°C"),
        sHR("土壤湿度", "%RH"),
        sEC("土壤电导率", "us/cm"),
        wEC("水环境电导率", "us/cm"),
        sPH("土壤ph", "ph值"),
        wPH("水环境ph", "ph值"),
        CO2("二氧化碳含量", "ppm"),
        FS("风速", "m/s"),
        RV("雨量", "雨量"),
        HCHO("甲醛", "ppm"),
        NOZ("噪声", "db"),
        PM25("pm2.5", "ug/m³"),
        PM10("pm10", "ug/m³"),
        PM100("pm100", "ug/m³"),
        UVA("紫外线", "w/㎡"),
        UVBA("紫外线B-A", "w/㎡"),
        GH("光合", "w/㎡"),
        LD("露点", "°C"),
        KP("钾离子", "ppm"),
        NAP("NAP", "ppm"),
        NO3P("硝酸根离子", "ppm"),
        AMO("氨气", "ppm"),
        sYF("sYF", "us/cm"),
        ZFL("蒸发量", "mm"),
        O2("氧气", "%vol"),
        RD("辐射", "w/㎡"),
        COD("水质COD", "mg/L"),
        NHN("水质氨氮", "mg/L"),
        C7H8("甲苯", "ppm"),
        NH4("氨氮", "ppm"),
        RO2("溶解氧", "mg/L"),
        FL("风力等级", "级"),
        NN("氮", "mg/kg"),
        PP("磷", "mg/kg"),
        KK("钾", "mg/kg"),
        TVOC("TVOC", "ppb"),
        WM("水表", "m³"),
        EM("电表", "电表"),
        WL("水位", "cm"),
        RVF("翻斗雨量计", "mm/h"),
        RVG("光学雨量计", "mm/h"),
        RVC("累计雨量", "mm"),
        O3("臭氧", "ppm"),
        OM("负氧离子", "cm3"),
        WY("位移", "mm"),
        C2H4("乙烯", "ppm"),
        SO2("二氧化硫", "ppm"),
        NO2("二氧化氮", "ppm"),
        TSP("TSP", "ug/m³"),
        CO("一氧化碳", "ppm"),
        NO("一氧化氮", "ppm"),
        H2S("硫化氢", "ppm"),
        KRQ("可燃气体", "%LEL"),
        PM1("PM1.0", "ug/m³"),
        wCL("水质余氯", "mg/L"),
        CXX("测斜X", "度"),
        CXY("测斜Y", "度");

        private String content;

        private String unit;

        public static ItemEnum getByName(String name) {
            ItemEnum[] values = ItemEnum.values();
            for (ItemEnum anEnum : values) {
                if (anEnum.name().equals(name)) {
                    return anEnum;
                }
            }
            return null;
        }
    }
}
